////////////////////////////////////////////////////////////////////////////////
//
//  MICROSOFT CORPORATION
//  Copyright (c) Microsoft Corporation.
//  All Rights Reserved.
//
//  NOTICE: Microsoft Confidential. Intended for Internal Use Only.
//
////////////////////////////////////////////////////////////////////////////////

package com.msn.beet.logging
{
/**
 * Value object used by Log utility for transporting data to ILogHandlers.
 */
public final class Message extends Object
{
    include "../core/Version.as";

    private var level:LogLevel;

    private var _content:Array /* of Object */;
    private var _upTime:int;
    private var _timeStamp:Date;
    private var _className:String;
    private var _line:uint;
    private var _cppValues:Array /* of Object */;

    /**
     *
     * @param content      The values passed to the Log utility.
     * @param level        The log level of the logging event.
     * @param time         The number of milliseconds after the document
     *                     class is initialized.
     * @param timeStamp    The time the log event occured.
     * @param className    The class in which the log call occured.
     * @param line         The line number at which the log call occured.
     * @param cppVals      Additional precompiler appended values.
     */
    public function Message(content:Array /* of Object */, level:LogLevel,
                            upTime:int, timeStamp:Date, className:String,
                            line:uint, cppVals:Array /* of Object */ = null)
    {
        this.level = level;

        _content   = content;
        _upTime    = upTime;
        _timeStamp = timeStamp;
        _className = className;
        _line      = line;
        _cppValues = cppVals;
    }

    /**
     * Returns an array containing the values passed to the Log utility.
     * @return
     */
    public function get content():Array /* of Object */
    {
        return _content;
    }

    /**
     * Returns the LogLevel of the message.
     * @return
     */
    public function get logLevel():LogLevel
    {
        return this.level;
    }

    /**
     * Returns the number of milliseconds after the document class is
     * initialized.
     * @return
     */
    public function get upTime():int
    {
        return _upTime;
    }

    /**
     * Returns a date object reflecting the time of the log event.
     * @return
     */
    public function get timeStamp():Date
    {
        return _timeStamp;
    }

    /**
     * The class in which the log call occured.
     * @return
     */
    public function get className():String
    {
        return this._className;
    }

    /**
     * The line number at which the log call occured.
     * @return
     */
    public function get line():uint
    {
        return this._line;
    }

    /**
     * Additional precompiler appended values.
     * @return
     */
    public function get cppValues():Array /* of Object */
    {
        return _cppValues;
    }
}

}
